import request from '@/utils/request'

// 查询出纳管理列列表
export function listCash(query) {
  return request({
    url: '/mes/fina/cash/list',
    method: 'get',
    params: query
  })
}

// 查询出纳统计表
export function balanceList(query) {
  return request({
    url: '/mes/fina/cash/balanceList',
    method: 'get',
    params: query
  })
}

// 查询ALL出纳统计表
export function balanceAllList(query) {
  return request({
    url: '/mes/fina/cash/balanceAllList',
    method: 'get',
    params: query
  })
}

// 查询出纳统计表
export function countList(query) {
  return request({
    url: '/mes/fina/cash/countList',
    method: 'get',
    params: query
  })
}

// 查询出纳支出统计表
export function finaOutCountList(query) {
  return request({
    url: '/mes/fina/cash/finaOutCountList',
    method: 'get',
    params: query
  })
}

// 查询出纳管理列详细
export function getCash(finaId) {
  return request({
    url: '/mes/fina/cash/' + finaId,
    method: 'get'
  })
}

// 新增出纳管理列
export function addCash(data) {
  return request({
    url: '/mes/fina/cash',
    method: 'post',
    data: data
  })
}

// 修改出纳管理列
export function updateCash(data) {
  return request({
    url: '/mes/fina/cash',
    method: 'put',
    data: data
  })
}

// 审核出纳管理列
export function checkCash(data) {
  console.log("form::::",JSON.stringify(data))
  return request({
    url: '/mes/fina/cash/check',
    method: 'post',
    data: data
  })
}

// 删除出纳管理列
export function delCash(finaId) {
  return request({
    url: '/mes/fina/cash/' + finaId,
    method: 'delete'
  })
}

// 同步出纳管理列
export function syncCash() {
  return request({
    url: '/mes/fina/cash/sync',
    method: 'get'
  })
}

// 同步出纳至金蝶管理列
export function syncK3Glvoucher(data) {
  console.log("syncK3Glvoucher::::",JSON.stringify(data))
  return request({
    url: '/mes/fina/cash/syncK3Glvoucher',
    method: 'post',
    data: data
  })
}

// 获取金蝶同步进度
export function getSyncProgress() {
  return request({
    url: '/mes/fina/cash/getSyncProgress',
    method: 'get'
  });
}
